cd /d %~dp0


set tmp=%2-1.%random%
for /f %%p in (%1) do   if not "x%%p" == "" %systemroot%\System32\wbem\wmic process where (ParentProcessId=%%p) get ProcessId | grep -P \d+ >>%tmp%
IF NOT EXIST %tmp% goto end
cat %tmp% >>%2
call %0 %tmp% %2
IF EXIST %2-1.*  del %2-1.*
:end
